/************************************************************
 * Project Name         [Thinking_In_Java]
 * File Name            [SizeComplex.java]
 * Creation Date        [20-Jun-2014]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ************************************************************/
package pkg_02_oop;

/**
 * Enum class
 * 
 * @author 不落的太阳(Sean Yang)
 * @version 1.0
 * @since JDK 6
 * 
 */
public enum SizeComplex {

	SMALL("小") {
		@Override
		public String toString() {
			return "小号";
		}
	},
	MEDIUM("中"), LARGE("大"), EXTRA_LARGE;

	// 枚举类里面声明属性, 只能放在枚举的后面
	private String value = "";

	/**
	 * 默认的构造方法为private
	 */
	SizeComplex() {
	}

	/**
	 * 带参数的构造方法
	 * 
	 * @param value
	 *            枚举值
	 */
	SizeComplex(String value) {
		this.value = value;
	}

	/**
	 * 获得属性value的值
	 * 
	 * @return value的值
	 */
	public String getValue() {
		return this.value;
	}

	/**
	 * 重写toString()方法
	 * 
	 * @return 枚举值的字符串表示
	 */
	@Override
	public String toString() {
		return this.getValue();
	}
}
